// 定义语音通知类型接口
interface VoiceNotification {
    title: string;
    name: string;
    file: string;
    message: string;
}

// 语音通知类型列表
export const Voice: Record<string, VoiceNotification> = {
    NEW_ORDER: {
        title: "新订单",
        name: "newOrder",
        file: "new_order.mp3",
        message: "您有新的订单，请及时处理！"
    },
    NEW_PRE_ORDER: {
        title: "新预订单",
        name: "newPreOrder",
        file: "new_pre_order.mp3",
        message: "您有新的预订单，请关注！"
    },
    PRE_ORDER_STOCK_UP: {
        title: "预订单备货",
        name: "preOrderStockUp",
        file: "pre_order_stock_up.mp3",
        message: "您有预订单快到时间了，请注意备货！"
    },
    NEW_PICKUP_TASK: {
        title: "新拣货任务",
        name: "newPickupTask",
        file: "new_pickup_task.mp3",
        message: "您有新的拣货任务，请及时处理！"
    },
    NEW_REVIEW_TASK: {
        title: "新复核任务",
        name: "newReviewTask",
        file: "new_review_task.mp3",
        message: "您有新的复核任务，请及时处理！"
    },
    ORDER_RECEIVE_TIMEOUT: {
        title: "订单接单超时",
        name: "orderReceiveTimeout",
        file: "order_receive_timeout.mp3",
        message: "您有订单接单已超时，请及时处理！"
    },
    ORDER_PICKUP_TIMEOUT: {
        title: "订单拣货超时",
        name: "orderPickupTimeout",
        file: "order_pickup_timeout.mp3",
        message: "您有订单拣货已超时，请及时处理！"
    },
    ORDER_CANCELED: {
        title: "订单已取消",
        name: "orderCanceled",
        file: "order_canceled.mp3",
        message: "您有订单被取消了，为避免损失，请不要备货！"
    },
    ORDER_CANCEL_APPLY: {
        title: "订单取消申请",
        name: "orderCancelApply",
        file: "order_cancel_apply.mp3",
        message: "有顾客申请取消订单，请及时处理！"
    },
    ORDER_REFUND_APPLY: {
        title: "订单退款申请",
        name: "orderRefundApply",
        file: "order_refund_apply.mp3",
        message: "有顾客申请退款，请及时处理！"
    },
    ORDER_CANCEL_APPLY_REPEAL: {
        title: "订单取消申请已撤销",
        name: "orderCancelApplyRepeal",
        file: "order_cancel_apply_repeal.mp3",
        message: "您有订单取消申请已撤销，请关注！"
    },
    ORDER_REFUND_APPLY_REPEAL: {
        title: "退款申请已撤销",
        name: "orderRefundApplyRepeal",
        file: "order_refund_apply_repeal.mp3",
        message: "您有订单退款申请已撤销，请关注！"
    },
    ORDER_REFUND_CANCELED: {
        title: "退款申请已撤销",
        name: "orderRefundCanceled",
        file: "order_refund_canceled.mp3",
        message: "您有订单发起退款成功，请关注！"
    },
    ORDER_SHIPPER_RECEIVE_TIMEOUT: {
        title: "骑手接单超时",
        name: "orderShipperReceiveTimeout",
        file: "order_shipper_receive_timeout.mp3",
        message: "您有订单骑手接单已超时，请及时处理！"
    },
    ORDER_DELIVERY_EXCEPTION: {
        title: "订单配送异常",
        name: "orderDeliveryException",
        file: "order_delivery_exception.mp3",
        message: "您有订单配送异常，请及时处理！"
    },
    AFS_ORDER_SHIPPER_RECEIVE_TIMEOUT: {
        title: "售后单骑手接单超时",
        name: "afsOrderShipperReceiveTimeout",
        file: "afs_order_shipper_receive_timeout.mp3",
        message: "您有售后单骑手接单已超时，请及时处理！"
    },
    AFS_ORDER_DELIVERY_EXCEPTION: {
        title: "售后单配送异常",
        name: "afsOrderDeliveryException",
        file: "afs_order_delivery_exception.mp3",
        message: "您有售后单配送异常，请及时处理！"
    },
    NETWORK_CONNECT_EXCEPTION: {
        title: "网络连接异常",
        name: "networkConnectException",
        file: "network_connect_exception.mp3",
        message: "网络连接异常，影响小票打印，请关注！"
    },
    BLUETOOTH_CONNECTED: {
        title: "蓝牙已连接",
        name: "bluetoothConnected",
        file: "bluetooth_connected.mp3",
        message: "蓝牙已连接！"
    },
    BLUETOOTH_CONNECT_FAIL: {
        title: "蓝牙连接已断开",
        name: "bluetoothConnectFail",
        file: "bluetooth_connect_fail.mp3",
        message: "蓝牙连接已断开，影响小票打印，请关注！"
    },
    ORDER_PRINTED: {
        title: "蓝牙连接已断开",
        name: "orderPrinted",
        file: "order_printed.mp3",
        message: "您有订单已被其他设备打印，请关注！"
    },
    ORDER_SEND_DELIVERY_FAIL: {
        title: "订单发配送失败",
        name: "orderSendDeliveryFail",
        file: "order_send_delivery_fail.mp3",
        message: "您有订单发配送失败，请及时处理！"
    }

};

// 处理获取语音通知类型的函数
export const handleGetVoiceTypeItem = (type: string): VoiceNotification | undefined => {
    switch (type) {
        case 'newOrder':
            return Voice.NEW_ORDER;
        case 'newPreOrder':
            return Voice.NEW_PRE_ORDER;
        case 'preOrderStockUp':
            return Voice.PRE_ORDER_STOCK_UP;
        case 'newPickupTask':
            return Voice.NEW_PICKUP_TASK;
        case 'newReviewTask':
            return Voice.NEW_REVIEW_TASK;
        case 'orderReceiveTimeout':
            return Voice.ORDER_RECEIVE_TIMEOUT;
        case 'orderPickupTimeout':
            return Voice.ORDER_PICKUP_TIMEOUT;
        case 'orderCanceled':
            return Voice.ORDER_CANCELED;
        case 'orderCancelApply':
            return Voice.ORDER_CANCEL_APPLY;
        case 'orderRefundApply':
            return Voice.ORDER_REFUND_APPLY;
        case 'orderShipperReceiveTimeout':
            return Voice.ORDER_SHIPPER_RECEIVE_TIMEOUT;
        case 'orderDeliveryException':
            return Voice.ORDER_DELIVERY_EXCEPTION;
        case 'afsOrderShipperReceiveTimeout':
            return Voice.AFS_ORDER_SHIPPER_RECEIVE_TIMEOUT;
        case 'afsOrderDeliveryException':
            return Voice.AFS_ORDER_DELIVERY_EXCEPTION;
        case 'orderRefundApplyRepeal':
            return Voice.ORDER_REFUND_APPLY_REPEAL;
        case 'orderCancelApplyRepeal':
            return Voice.ORDER_CANCEL_APPLY_REPEAL;
        case 'orderRefundCanceled':
            return Voice.ORDER_REFUND_CANCELED;
        default:
            return undefined;
    }
};